package com.bckj.fastboot.upms.biz.mapper;

import com.bckj.fastboot.upms.api.entity.SysRole;
import com.bckj.fastboot.upms.api.vo.SysRoleVO;
import com.bckj.fastboot.upms.api.dto.SysRoleQuery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.jdbc.SQL;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;

/**
 * 角色表(SysRole)表数据库访问层
 *
 * @author wfc
 * @since 2023-09-14 10:12:51
 */
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRole> {

    /**
      * 列表
      *
      * @param query req
      * @return list
      */
    @SelectProvider(method = "list" , type = SysRoleProvider.class)
    List<SysRoleVO> list(SysRoleQuery query);
    
    class SysRoleProvider{
        
        public String list(SysRoleQuery query){
            return new SQL(){{
                SELECT("id, client_id, role_name, role_key, role_status, delete_flag, remark, create_time, update_time, num, create_id");
                FROM("sys_role");
                ORDER_BY("id DESC");
            }}.toString();
        }
    }
}

